package com.mccken.designpattern.strategy.strategy_01;

/**
 * @program: mccken-collect
 * @description:
 * @author: mccken
 * @create: 2024-01-14 18:39
 **/
public class McckenStrategyContext {
	
	// 维持一个对抽象策略类的引用
	private AbstractStrategy abstractStrategy;
	
	public void setAbstractStrategy(AbstractStrategy abstractStrategy) {
		this.abstractStrategy = abstractStrategy;
	}
	
	// 调用策略类的算法
	public void algorithm() {
		abstractStrategy.algorithm();
	}
}
